package day25.edu;

import org.junit.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

// Created: 25/09/2025, ChangJiang Ru
public class propertiesTest {
    @Test
    public void test1() throws IOException {
        File file = new File("info.properties");
        System.out.println(file.getAbsoluteFile());

        FileInputStream fis = new FileInputStream(file);
        Properties pros = new Properties();
        pros.load(fis);

        // Read data
        String nameValue = pros.getProperty("name");
        String passwordValue = pros.getProperty("password");

        System.out.println(nameValue);
        System.out.println(passwordValue);

        fis.close();
    }
}
